package geom;

/**
 * This class models a point.
 * @author Magnus Brand
 *
 */
public class Point {
	private double x, y;
	/**
	 * Returns x coordinate
	 * @return x coordinate
	 */
	public double getX() {
		return x;
	}
	/**
	 * Sets the x coordinate
	 * @param x Sets the x coordinate
	 */
	public void setX(double x) {
		this.x = x;
	}
	/**
	 * Returns y coordinate
	 * @return y coordinate
	 */
	public double getY() {
		return y;
	}
	/**
	 * Sets the y coordinate
	 * @param y y coordinate
	 */
	public void setY(double y) {
		this.y = y;
	}
	/**
	 * Creates a new Point object
	 * @param x the x coordinate
	 * @param y the y coordinate
	 */
	public Point(double x, double y) {
		this.x = x;
		this.y = y;
	}
	public double distanceTo(Point position) {
		return Math.sqrt( Math.pow(position.getX()-x , 2) + Math.pow(position.getY()-y, 2) );
	}
	
	
}
